package com.pucheng.bracelet.viewmodel.sleep

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.asLiveData
import com.pucheng.bracelet.app.database.repository.SleepRepository
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import com.pucheng.bracelet.app.util.DatetimeUtil
import com.pucheng.bracelet.data.bean.SleepBean

class SleepViewModel : BaseViewModel() {


    private val sleepRepository: SleepRepository = SleepRepository()
    var sleepData=MutableLiveData<SleepBean>()
    var sleepDataInfo = sleepRepository.getSleepsInfoToDate(
        DatetimeUtil.formatDate(
            System.currentTimeMillis(),
            DatetimeUtil.DATE_PATTERN
        )
    )
    var sleepTo7Day: LiveData<List<SleepBean>> = sleepRepository.allDataTo7DayToSleep
    var sleepToAll: LiveData<List<SleepBean>> = sleepRepository.allDataToSleep



}